package com.bluedot.interceptor;

import java.util.Map;

import com.bluedot.domain.User;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

public class LogonInterceptor extends AbstractInterceptor {

	@Override
	public String intercept(ActionInvocation invo) throws Exception {
		Map map = ActionContext.getContext().getSession();
		User user = (User) map.get("user");
		String result = "";
		if (user == null) {
			result = "input";

		} else {
			result = invo.invoke();

		}
		return result;
	}

}
